feat: add RuntimeStats TypeScript interface to embed addon#969
Merged
gianni-cor merged 2 commits intoMar 18, 2026
Conversation
gianni-cor
approved these changes
Mar 18, 2026
dev-nid
approved these changes
Mar 18, 2026
Contributor
|
/review |
Contributor
Tier-based Approval Status |
Add RuntimeStats type to index.d.ts covering all stats keys returned by the C++ BertModel::runtimeStats(): total_tokens, total_time_ms, tokens_per_second, batch_size, context_size. Bump version to 0.12.1.
The C++ BertModel::runtimeStats() only emits tokens_per_second when t_p_eval_ms > 0. Mark the field optional to match the actual runtime payload shape.
788c0b6 to
bdf4004
Compare
Contributor
|
/review |
Proletter
pushed a commit
that referenced
this pull request
May 24, 2026
* feat: add RuntimeStats TypeScript interface to embed addon Add RuntimeStats type to index.d.ts covering all stats keys returned by the C++ BertModel::runtimeStats(): total_tokens, total_time_ms, tokens_per_second, batch_size, context_size. Bump version to 0.12.1. * fix: make tokens_per_second optional in RuntimeStats The C++ BertModel::runtimeStats() only emits tokens_per_second when t_p_eval_ms > 0. Mark the field optional to match the actual runtime payload shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
BertModel::runtimeStats()returns structured stats but there was no TypeScript type for consumers to reference.RuntimeStatstype added to the LLM addon in PR feat(llm): expose contextSlides stat from C++ runtime stats #937.How does it solve it?
RuntimeStatsinterface toindex.d.tswith all 5 keys returned by the C++ addon:total_tokens,total_time_ms,tokens_per_second,batch_size,context_size.API Changes